package test;

import java.util.HashSet;

public class A {
	
	public static void main(String[] args) {
		Auto a1 = new Auto(1234567890);
		Auto a2 = new Auto(1234567890);
		
		HashSet<Auto> autoSet = new HashSet<Auto>();
		autoSet.add(a1);
		autoSet.add(a2);
		System.out.println(autoSet.size());
	}
}

class Auto {
	
	private long id;

	public Auto(long id) {
		this.id = id;
	}
	
	public int hashCode() {
		return (int) id;
	}
	
	@Override
	public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (o == null) {
			return false;
		}
		if (this.getClass() != o.getClass()) {
			return false;
		}
		return id == ((Auto) o).id;
	}
	
	
}